/*********************************************************************
* File: IRadar.h
*
* Supports agents' radar.
*********************************************************************/
#pragma once

#include "../globals.h"
#include "../../game/globals.h"
using namespace game;

namespace agents{namespace interfaces{
	/**
	* \class IRadar
	* \brief Simulates the radar.
	*
	* Monitors agent location and bomb position. Provides accurate position up
	* to 2,200 distance units.
	*
	* \author Instituto Superior Tecnico de Lisboa, Portugal
	* \author Technical University of Lisbon, Portugal
	* 
	* \author Agentes Autonomos e Sistemas Multiagente
	* \author Autonomous Agents and Multiagent Systems
	* 
	* \version	1.0
	* \date		2006/2007
	**/
	class IRadar
	{
	public:
		//=====================================================================
		// Classes
		//=====================================================================
		/**
		* \class RadarUnit
		* \brief A visible agent or bomb in the world.
		**/
		class RadarUnit
		{
		public:
			void set(Vector ownerPosition, Vector unitPosition, bool isTeammate, bool isBomb, bool isArmedBomb);
			/**
			* \brief Distance towards the unit.
			*
			* Maximum accuracy is 2,200 units. 
			**/
			float distance;
			/**
			* \brief Direction towards the unit.
			*
			* The direction vector is normalized. 
			**/
			Vector direction;
			/**
			* \brief Whether this unit is a teammate.
			**/
			bool isTeammate;
			/**
			* \brief Whether this unit is a bomb.
			*
			* Can be either armed or in backpack.
			**/
			bool isBomb;
			/**
			* \brief Whether this unit is an armed bomb.
			**/
			bool isArmedBomb;
		};

		//=====================================================================
		// Function prototypes
		//=====================================================================
		/**
		* \brief Gets the radar visible teammates or bomb locations. 
		*
		* Provides accurate position up to a distance of 2,200 units.
		*
		* \param[out] count The number of visible units.
		* \return The list of radar visible units.
		**/
		virtual RadarUnit* getRadarVisibleUnits(int* count) = 0;
	};
}}
